function(generate_parameters_header package_name project_target)
  
    set(PARAMS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/config/parameters.yaml")
    if(NOT EXISTS ${PARAMS_FILE})
        message(WARNING "parameters.txt not found for package ${package_name}")
        return()
    endif()

    set(OUTPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
    set(OUTPUT_FILE "${OUTPUT_DIR}/parameters.hpp")
   
    set(GENERATOR_SCRIPT "${generate_parameters_header_DIR}/../../../lib/generate_parameters_header/generate_parameters.py")
    set(TEMPLATE_FILE "${generate_parameters_header_DIR}/../templates/parameters_template.ini")

    file(MAKE_DIRECTORY ${OUTPUT_DIR})

    add_custom_command(
        OUTPUT ${OUTPUT_FILE} 
        COMMAND ${Python3_EXECUTABLE} ${GENERATOR_SCRIPT}
            --input ${PARAMS_FILE}
            --output ${OUTPUT_FILE}
            --template ${TEMPLATE_FILE}
            --package ${project_target}
        DEPENDS 
            ${PARAMS_FILE} 
            ${TEMPLATE_FILE}
            ${GENERATOR_SCRIPT}  
        COMMENT "Generating parameters header for ${PROJECT_NAME}"
        VERBATIM
    )

    add_custom_target(
        ${project_target}_parameters_target
        DEPENDS ${OUTPUT_FILE}
        COMMENT "Triggering parameters header generation"
    )

    add_dependencies(${project_target} ${project_target}_parameters_target)
endfunction()